Telegram Group & Telegram Channel
3. Determining variable type with type()

>> a=7
>>> type(a)
<class 'int'>

>>> b=7.7
>>> type(b)
<class 'float'>

>>> c="hello"
>>> type(c)
<class 'str'>

>>> d=[1,2,3]
>>> type(d)
<class 'list'>

>>> e=(1,2,3)
>>> type(e)
<class 'tuple'>

>>> f={1:"one",2:"two"}
>>> type(f)
<class 'dict'>

>>> g={1,2,3}
>>> type(g)
<class 'set'>

>>> i=True
>>> type(i)
<class 'bool'>





You can check what type of object is assigned to a variable using Python's built-in type() function. Common data types include:

int (for integer)
float
str (for string)
list
tuple
dict (for dictionary)
set
bool (for Boolean True/False)

@python_codes



tg-me.com/python_codes/6
Create:
Last Update:

3. Determining variable type with type()

>> a=7
>>> type(a)
<class 'int'>

>>> b=7.7
>>> type(b)
<class 'float'>

>>> c="hello"
>>> type(c)
<class 'str'>

>>> d=[1,2,3]
>>> type(d)
<class 'list'>

>>> e=(1,2,3)
>>> type(e)
<class 'tuple'>

>>> f={1:"one",2:"two"}
>>> type(f)
<class 'dict'>

>>> g={1,2,3}
>>> type(g)
<class 'set'>

>>> i=True
>>> type(i)
<class 'bool'>





You can check what type of object is assigned to a variable using Python's built-in type() function. Common data types include:

int (for integer)
float
str (for string)
list
tuple
dict (for dictionary)
set
bool (for Boolean True/False)

@python_codes

BY Python Codes


Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283

Share with your friend now:
tg-me.com/python_codes/6

View MORE
Open in Telegram


Python Codes Telegram | DID YOU KNOW?

Date: |

How to Use Bitcoin?

n the U.S. people generally use Bitcoin as an alternative investment, helping diversify a portfolio apart from stocks and bonds. You can also use Bitcoin to make purchases, but the number of vendors that accept the cryptocurrency is still limited. Big companies that accept Bitcoin include Overstock, AT&T and Twitch. You may also find that some small local retailers or certain websites take Bitcoin, but you’ll have to do some digging. That said, PayPal has announced that it will enable cryptocurrency as a funding source for purchases this year, financing purchases by automatically converting crypto holdings to fiat currency for users. “They have 346 million users and they’re connected to 26 million merchants,” says Spencer Montgomery, founder of Uinta Crypto Consulting. “It’s huge.”

The STAR Market, as is implied by the name, is heavily geared toward smaller innovative tech companies, in particular those engaged in strategically important fields, such as biopharmaceuticals, 5G technology, semiconductors, and new energy. The STAR Market currently has 340 listed securities. The STAR Market is seen as important for China’s high-tech and emerging industries, providing a space for smaller companies to raise capital in China. This is especially significant for technology companies that may be viewed with suspicion on overseas stock exchanges.

Python Codes from in


Telegram Python Codes
FROM USA